package com.artron.mediaartron.data.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by qi on 2017/12/11.
 */

public class GiftCardData implements Parcelable {

    /**
     * pageTotal : 2
     * giftcardLogs : [{"tradeAmount":-299,"isRefunded":"N","passId":"12f0ccf8799a4cb2a0abeb777fb62bc2","id":"ac3b50d41d9b4fe59544be7dde94b31d","remarks":"购买商品","tradeType":"expense","createDate":"2017-12-01 11:28:34"}]
     * pageNo : 1
     * recordCount : 11
     * pageSize : 10
     */
    private int pageTotal;
    private List<GiftcardLogsEntity> giftcardLogs;
    private int pageNo;
    private int recordCount;
    private int pageSize;

    public void setPageTotal(int pageTotal) {
        this.pageTotal = pageTotal;
    }

    public void setGiftcardLogs(List<GiftcardLogsEntity> giftcardLogs) {
        this.giftcardLogs = giftcardLogs;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public void setRecordCount(int recordCount) {
        this.recordCount = recordCount;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public List<GiftcardLogsEntity> getGiftcardLogs() {
        return giftcardLogs;
    }

    public int getPageNo() {
        return pageNo;
    }

    public int getRecordCount() {
        return recordCount;
    }

    public int getPageSize() {
        return pageSize;
    }

    public class GiftcardLogsEntity {
        /**
         * tradeAmount : -299
         * isRefunded : N
         * passId : 12f0ccf8799a4cb2a0abeb777fb62bc2
         * id : ac3b50d41d9b4fe59544be7dde94b31d
         * remarks : 购买商品
         * tradeType : expense
         * createDate : 2017-12-01 11:28:34
         */
        private int tradeAmount;
        private String isRefunded;
        private String passId;
        private String id;
        private String remarks;
        private String tradeType;
        private String createDate;

        public void setTradeAmount(int tradeAmount) {
            this.tradeAmount = tradeAmount;
        }

        public void setIsRefunded(String isRefunded) {
            this.isRefunded = isRefunded;
        }

        public void setPassId(String passId) {
            this.passId = passId;
        }

        public void setId(String id) {
            this.id = id;
        }

        public void setRemarks(String remarks) {
            this.remarks = remarks;
        }

        public void setTradeType(String tradeType) {
            this.tradeType = tradeType;
        }

        public void setCreateDate(String createDate) {
            this.createDate = createDate;
        }

        public int getTradeAmount() {
            return tradeAmount;
        }

        public String getIsRefunded() {
            return isRefunded;
        }

        public String getPassId() {
            return passId;
        }

        public String getId() {
            return id;
        }

        public String getRemarks() {
            return remarks;
        }

        public String getTradeType() {
            return tradeType;
        }

        public String getCreateDate() {
            return createDate;
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.pageTotal);
        dest.writeList(this.giftcardLogs);
        dest.writeInt(this.pageNo);
        dest.writeInt(this.recordCount);
        dest.writeInt(this.pageSize);
    }

    public GiftCardData() {
    }

    protected GiftCardData(Parcel in) {
        this.pageTotal = in.readInt();
        this.giftcardLogs = new ArrayList<GiftcardLogsEntity>();
        in.readList(this.giftcardLogs, GiftcardLogsEntity.class.getClassLoader());
        this.pageNo = in.readInt();
        this.recordCount = in.readInt();
        this.pageSize = in.readInt();
    }

    public static final Parcelable.Creator<GiftCardData> CREATOR = new Parcelable.Creator<GiftCardData>() {
        @Override
        public GiftCardData createFromParcel(Parcel source) {
            return new GiftCardData(source);
        }

        @Override
        public GiftCardData[] newArray(int size) {
            return new GiftCardData[size];
        }
    };
}
